#pragma once


#include "Pages/EditorPageViewModel.h"
#include "EditorMaterialPageModel.h"
#include "Math/Vec2.h"

#include "EditorMaterialPageViewModel.m.h"

class RTexture2D;
class RMaterialGraphViewModel;

RCLASS()
class REditorMaterialPageViewModel : public REditorPageViewModel 
{
    ROBJECT

public:
    void BindModel(TSharedObjectPtr<REditorPageModel> InModel) override;
    TSharedObjectPtr<RTexture2D> GetIcon() const override;
    CString GetTitle() const override;
    virtual float GetOperationsWidth() override;



    TSharedObjectPtr<RMaterialGraphViewModel> GetGraph() const
    {
        return MaterialGraphViewModel;
    }

    TSharedObjectPtr<RTexture2D> GetUpdateIcon() const
    {
        return UpdateIcon;
    }

    void UpdateMaterial();
protected:
    TSharedObjectPtr<RTexture2D> Icon;
    TWeakObjectPtr<REditorMaterialPageModel> MaterialModel;

    TSharedObjectPtr<RMaterialGraphViewModel> MaterialGraphViewModel;

    TSharedObjectPtr<RTexture2D>  UpdateIcon;
};
